

# Tell SCons to create our build files in the 'build' directory
#VariantDir('build', 'src', duplicate=0)
VariantDir('build', 'src', duplicate=0)

# Set our source files
source_files = ['server.cpp','client.cpp','hmac.cpp','multi.pb.cc']

# Set our required libraries
libraries = ['protobuf','boost_system','boost_filesystem','boost_unit_test_framework', 'pthread','ssh2', 'crypto', 'pcap']

library_paths = ''

env = Environment()
env.VariantDir('build', 'src', duplicate=0)
myfile = env.Command( ['multi.pb.cc', 'multi.pb.h'], 'multi.proto', 'protoc --cpp_out=. $SOURCE.file')
#env.AlwaysBuild(myfile)
# Set our g++ compiler flags

env.Append( CPPFLAGS=['-pthread', '-c'] )


lib = env.StaticLibrary('util', source_files)
##env.InstallAs( target = "lib/", source = lib );
# Tell SCons the program to build
#env.Program('build/c++threads', source_files, LIBS = libraries, LIBPATH = library_paths)



env.Program('server',  ['main.cpp'], LIBS = lib + libraries )
env.Program('client',  ['main.cpp'], LIBS = lib + libraries )

test_lib = env.Program('unittest.test',  ['unittest.cpp'], LIBS = lib + libraries )
run_unittest = env.Command([], 'unittest.test' ,'ttest.test')
env.AlwaysBuild(run_unittest)


test = Command('alasdas',
                source = "unittest.test",
                action = ["./unittest.test"] )
AlwaysBuild( test )
#env.Command(['test_util2'],'test.cpp', './$SOURCE.dir/test_util' )

